/*    */ package com.controller;


/*    */ 
/*    */

import com.domain.StudentBook;
import com.github.pagehelper.PageInfo;
import com.service.IStuBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/*    */
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Controller
/*    */ @RequestMapping({"/stuAndBook"})
/*    */ public class StuAndBookController
/*    */ {
/*    */   @Autowired
/*    */   private IStuBookService stuBookService;
/*    */   
/*    */   @RequestMapping({"/findAll"})
/*    */   public ModelAndView findAll(@RequestParam(name = "page") Integer page, @RequestParam(name = "size") Integer size) {
/* 28 */     ModelAndView mv = new ModelAndView();
/* 29 */     List<StudentBook> studentBooks = this.stuBookService.findAll(page, size);
/* 30 */     PageInfo pageInfo = new PageInfo(studentBooks);
/* 31 */     mv.addObject("pageInfo", pageInfo);
/* 32 */     mv.setViewName("/book/stu-book");
/* 33 */     return mv;
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   @RequestMapping({"/delete"})
/*    */   public ModelAndView delete(@RequestParam(name = "id") Integer id, @RequestParam(name = "page") Integer page, @RequestParam(name = "size") Integer size) {
/* 43 */     ModelAndView mv = new ModelAndView();
/* 44 */     this.stuBookService.delete(id);
/* 45 */     this.stuBookService.updateId(id);
/* 46 */     this.stuBookService.autoIncrement();
/* 47 */     mv.setViewName("redirect:/stuAndBook/findAll?page=" + page + "&size=" + size);
/* 48 */     return mv;
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   @RequestMapping({"/findAllLate"})
/*    */   public ModelAndView findAllLate(@RequestParam(name = "page") Integer page, @RequestParam(name = "size") Integer size) {
/* 58 */     ModelAndView mv = new ModelAndView();
/* 59 */     List<StudentBook> studentBooks = this.stuBookService.getAllLate(page, size);
/* 60 */     PageInfo pageInfo = new PageInfo(studentBooks);
/* 61 */     mv.addObject("pageInfo", pageInfo);
/* 62 */     mv.setViewName("/book/stu-book-late");
/* 63 */     return mv;
/*    */   }
/*    */ }


/* Location:              G:\项目\图书管理系统\library_system-1.0-SNAPSHOT.war!\WEB-INF\classes\com\controller\StuAndBookController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */